const path = require("path");
const webpack = require("webpack");

module.exports = {
    mode: 'production',
    entry: "./scripts/App.ts",
    output: {
        path: path.resolve(__dirname, "output"),
        filename: 'bound.js'
    },
    optimization: {
        minimize: false
    },
    plugins: [
        new webpack.ProvidePlugin({
            bt: path.resolve(path.join(__dirname, 'scripts/libs/bt.js')),
        })
    ],
    resolve: {
        extensions: ['.ts'],
    },
    module: {
        rules: [
            {
                test: /\.ts$/,
                use: {
                    loader: 'ts-loader',
                    options: {
                        compilerOptions: {
                            target: 'ES5',
                            module: 'commonjs',
                            lib: ['DOM', 'ES2015', 'ES2017', 'ES2016', 'ES2018'],
                            removeComments: true,
                            skipLibCheck: true
                        }
                    }
                },
                exclude: /node_modules/,
            }
        ]
    },
};
